package com.example.userspringboot.mapper;

import com.example.userspringboot.entity.DrugDetails;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DrugDetailsMapper {
    @Select("select * from `drug_details` " +
            "left join `drug_classification` on drug_details.classification_id = drug_classification.id " +
            "where drug_classification.name = #{classificationName}")
    List<DrugDetails> selectDetailsByClassificationName(String classificationName);

    @Select("select * from `drug_details` where id = #{id}")
    DrugDetails selectById(Integer id);

    @Update("update `drug_details` set number = #{number} where id = #{id}")
    void updateById(DrugDetails dbDrugDetails);
}
